﻿using System.Web.Http.SelfHost;
using ZLWeb.WebApiConfigration.WebapiAppsetting;

namespace ZLWeb.WebApiConfigration.SelfHostConfig
{
    /// <summary>
    /// 自寄宿的配置，为了连接controller和Soa
    /// </summary>
    public class SelfHostConfig
    {
        private SelfHostConfig()
        {
            //不能写成localhost 否则fiddler抓不到包
            HttpSelfHostConfiguration = new HttpSelfHostConfiguration(ZLWebApiAppSetting.GetAppSetting().SelfHostUrl);
        }

        private static SelfHostConfig selfHostConfig;

        public static SelfHostConfig GlobalHostConfig
        {
            get { return selfHostConfig ?? (selfHostConfig = new SelfHostConfig()); }
        }

        public HttpSelfHostConfiguration HttpSelfHostConfiguration { get; set; }
    }
}